package com.uzai.console.enums;

import com.alibaba.excel.util.StringUtils;

/**
 * 合同状态类型枚举
 * @Auther: liuyanyan
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum ContractStatusTypeEnum {

    DRAFT(0,"草稿"),
    UNDER_SIGNATURE(1,"签署中"),
    COMPLETE(2,"完成"),
    CANCEL(3,"撤销"),
    EXPIRED(5,"过期"),
    VISA_REJECTION(7,"拒签"),
    ;

    private Integer key;
    private String desc;

    ContractStatusTypeEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static ContractStatusTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (ContractStatusTypeEnum type: ContractStatusTypeEnum.values()) {
            if (type.getKey().intValue() == id.intValue()) {
                return type;
            }
        }
        return null;
    }
}
